--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
flatpak-build.sh v3.3.2 (aaa1e9b0) Text, 2.94 KB
T8b949e#!/bin/bash
Tffa657set -e
Tffa657export Te6edf3HOMETff7b72=/tmp/build
Tffa657export Te6edf3XDG_CONFIG_HOMETff7b72=/tmp/build/.config
Tffa657export Te6edf3XDG_DATA_HOMETff7b72=/tmp/build/.local/share
mkdir -p /tmp/build/.config /tmp/build/.local/share
Te6edf3NODE_PATHSTff7b72=Tff7b72(
Ta5d6ff"/usr/lib/sdk/node20/bin"
Ta5d6ff"/usr/lib/sdk/node20/root/usr/bin"
Ta5d6ff"/usr/lib/sdk/node/bin"
Ta5d6ff"/usr/lib/sdk/node/root/usr/bin"
Tff7b72)
Te6edf3NODE_BINTff7b72=Ta5d6ff""
Te6edf3NPM_BINTff7b72=Ta5d6ff""
Tff7b72for path Tff7b72in Ta5d6ff"Tffd700${Te6edf3NODE_PATHSTb4b4b4[@]Tffd700}Ta5d6ff"Tb4b4b4; Tff7b72do
Tff7b72if Tff7b72[ -f Ta5d6ff"Te6edf3$pathTa5d6ff/nodeTa5d6ff" Tff7b72] Tff7b72&& Tff7b72[ -f Ta5d6ff"Te6edf3$pathTa5d6ff/npmTa5d6ff" Tff7b72]Tb4b4b4; Tff7b72then
Te6edf3NODE_BINTff7b72=Ta5d6ff"Te6edf3$pathTa5d6ff/nodeTa5d6ff"
Te6edf3NPM_BINTff7b72=Ta5d6ff"Te6edf3$pathTa5d6ff/npmTa5d6ff"
Tffa657export Te6edf3PATHTff7b72=Ta5d6ff"Te6edf3$pathTa5d6ff:Te6edf3$PATHTa5d6ff"
Tff7b72break
Tff7b72fi
Tff7b72done
Tff7b72if Tff7b72[ -z Ta5d6ff"Te6edf3$NODE_BINTa5d6ff" Tff7b72] Tff7b72|| Tff7b72[ -z Ta5d6ff"Te6edf3$NPM_BINTa5d6ff" Tff7b72]Tb4b4b4; Tff7b72then
Tff7b72if Tffa657command -v node >/dev/null T79c0ff2>Tb4b4b4&T79c0ff1 Tff7b72&& Tffa657command -v npm >/dev/null T79c0ff2>Tb4b4b4&T79c0ff1Tb4b4b4; Tff7b72then
Te6edf3NODE_BINTff7b72=Tff7b72$(Tffa657command -v nodeTff7b72)
Te6edf3NPM_BINTff7b72=Tff7b72$(Tffa657command -v npmTff7b72)
Tff7b72else
Tffa657echo Ta5d6ff"Error: Node.js binaries not found. Checking common locations..."
find /usr/lib/sdk -name node -type f T79c0ff2>/dev/null Tb4b4b4| head -1
find /usr/lib/sdk -name npm -type f T79c0ff2>/dev/null Tb4b4b4| head -1
Tffa657exit T79c0ff1
Tff7b72fi
Tff7b72fi
Tffa657echo Ta5d6ff"Ta5d6ffUsing Node.js: Te6edf3$NODE_BINTa5d6ff"
Tffa657echo Ta5d6ff"Ta5d6ffUsing npm: Te6edf3$NPM_BINTa5d6ff"
Te6edf3PNPM_VERSIONTff7b72=Ta5d6ff"10.0.0"
Te6edf3NPM_PREFIXTff7b72=Ta5d6ff"Te6edf3$HOMETa5d6ff/.localTa5d6ff"
mkdir -p Ta5d6ff"Te6edf3$NPM_PREFIXTa5d6ff"
Tffa657export Te6edf3npm_config_prefixTff7b72=Ta5d6ff"Te6edf3$NPM_PREFIXTa5d6ff"
Te6edf3$NPM_BIN config Tffa657set prefix Ta5d6ff"Te6edf3$NPM_PREFIXTa5d6ff"
Tffa657echo Ta5d6ff"Ta5d6ffInstalling pnpm via npm to Te6edf3$NPM_PREFIXTa5d6ff...Ta5d6ff"
Te6edf3$NPM_BIN install -g pnpm@Tffd700${Te6edf3PNPM_VERSIONTffd700} Tff7b72|| Tffa657exit T79c0ff1
Tffa657export Te6edf3PATHTff7b72=Ta5d6ff"Te6edf3$NPM_PREFIXTa5d6ff/bin:Te6edf3$PATHTa5d6ff"
python3 scripts/sync_version.py
pnpm install --frozen-lockfile
pnpm run build
mkdir -p /tmp/electron-install
Tffa657cd /tmp/electron-install
pnpm init
pnpm add electron@39.2.7
Tffa657cd -
pip3 install poetry
poetry install --no-dev
poetry run python cx_setup.py build
mkdir -p /app/bin /app/lib/reticulum-meshchatx /app/share/applications /app/share/icons/hicolor/512x512/apps
cp -r electron /app/lib/reticulum-meshchatx/
cp -r build/exe /app/lib/reticulum-meshchatx/
mkdir -p /app/lib/reticulum-meshchatx/electron-bin
cp -r /tmp/electron-install/node_modules/electron/* /app/lib/reticulum-meshchatx/electron-bin/
cp logo/logo.png /app/share/icons/hicolor/512x512/apps/com.sudoivan.reticulummeshchat.png
cat > /app/share/applications/com.sudoivan.reticulummeshchat.desktop Ta5d6ff<<'EOF'
[Desktop Entry]
Type=Application
Name=Reticulum MeshChatX
Comment=A simple mesh network communications app powered by the Reticulum Network Stack
Exec=reticulum-meshchatx
Icon=com.sudoivan.reticulummeshchat
Categories=Network;InstantMessaging;
StartupNotify=true
EOF
cat > /app/bin/reticulum-meshchatx Ta5d6ff<<'EOF'
export ELECTRON_IS_DEV=0
export APP_PATH=/app/lib/reticulum-meshchatx/electron
export EXE_PATH=/app/lib/reticulum-meshchatx/build/exe/ReticulumMeshChatX
ELECTRON_BIN=/app/lib/reticulum-meshchatx/electron-bin/dist/electron
if [ ! -f "$ELECTRON_BIN" ]; then
ELECTRON_BIN=$(find /app/lib/reticulum-meshchatx/electron-bin -name electron -type f 2>/dev/null | head -1)
fi
cd /app/lib/reticulum-meshchatx/electron
exec "$ELECTRON_BIN" . "$@"
EOF
chmod +x /app/bin/reticulum-meshchatx
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────